{extend name="public:layout" /}
{block name="title"}编辑品牌{/block}
{block name="head"}
<style>
    .sui-tree-group select{float:left;width:32%;}
</style>
{/block}
{block name="body"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox">
        <div class="ibox-title">
            <ol class="breadcrumb">
                <li><i class="fa fa-hand-o-right"></i> <a href="{:url('index')}"> 品牌列表</a></li>
                <li class="active">编辑品牌</li>
            </ol>
        </div>
        <div class="ibox-content">
            <form method="post" class="form-horizontal" id="form">
                <input type="hidden" name="cid_path" id="cidPatch" value="{$info.cid_path}" />
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">品牌名称</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入品牌名称"
                               name="brand_name" value="{$info.brand_name}" datatype="*"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">品牌首字母</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="品牌首字母"
                               name="brand_initial" value="{$info['brand_initial']}" datatype="*"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">绑定分类</label>
                    <div class="col-sm-6">
                        <div data-toggle="tree" data-src="{:url('plus/Category/ajaxGoodsCate')}" data-jsonp="false" class="sui-tree-group" data-val="[{$info.cid_path}]"></div>
                        <div class="clearfix"></div>
                        <p class="help-block">
                            选择分类，可关联大分类或更具体的下级分类
                        </p>
                        <script>
                            In('ajaxtree');
                        </script>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">品牌logo</label>
                    <div class="col-sm-4">
                        <p class="form-control-static">
                            {:widget('common/Form/singleImg',['brand_logo','value'=>$info['brand_logo'],$uid])}
                        </p>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">是否推荐</label>
                    <div class="col-sm-4">
                        <label class="radio-inline i-checks">
                            <input type="radio" name="brand_recommend" value="0" {eq name="info.brand_recommend" value="0"}checked{/eq}> 否
                        </label>
                        <label class="radio-inline i-checks">
                            <input type="radio" name="brand_recommend" value="1" {eq name="info.brand_recommend" value="1"}checked{/eq}> 是
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">状态</label>
                    <div class="col-sm-4">
                        <label class="radio-inline i-checks">
                            <input type="radio" name="brand_status" value="1" {eq name="info.brand_status" value="1"}checked{/eq}> 通过
                        </label>
                        <label class="radio-inline i-checks">
                            <input type="radio" name="brand_status" value="0" {eq name="info.brand_status" value="0"}checked{/eq}> 审核中
                        </label>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">品牌排序</label>
                    <div class="col-sm-2">
                        <input type="text" class="form-control"
                               name="brand_sort" value="{$info.brand_sort}" datatype="n" />
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-10 col-sm-offset-2">
                        <button class="btn btn-primary" type="button" id="btnSub">
                            保存内容
                        </button>
                        <a href="{:url('index')}" class="btn btn-white">取消</a>
                        <span id="validError"></span>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        $('.sui-tree-group').on('click','select',function () {
            var selectValue = $('.sui-tree-group').data('tree').datas;
            if(selectValue!=undefined){
                var arr = selectValue.value;//后台返回数据
                $('#cidPatch').val(arr.join());
            }else{
                $('#cidPatch').val('');
            }
        })
        iCheck();
        ajaxSubForm('#btnSub');
    })
</script>
{/block}